<?php
  require_once('inc_admin.php');
  //连接数据库   
  connect();

  if(!empty($_FILES["zq_pic"]["name"])){
    $zq_pic = uploadfile('zq_pic',UserPhotoPath,array('jpg','gif','png'));
  }
  else{
    $zq_pic='';
  }
  $data = array(
    'zq_title' => $_POST['title'],
    'zq_pic'=>$zq_pic,
    'zq_place' => $_POST['place'],
    'zq_intro' => $_POST['intro'],
    'zq_adddate' => $_POST['date']
    );
  //执行SQL语句
  $result = add('flower',$data);

  if(!$result){
    echo "添加失败！<br/>";
    echo "<a href='addflower.php'>返回</a>";   
  }else{    
    redirect('flowerlist.php','添加成功！');
  }    
  
?>
